Skip to main content

Null Value

Create sample DataFrame

  • Create sample CSV file

    data_with_nan.csv

    col1,col2,col3
    test1,13,
    test2,44,aaa
    test3,,
    ,,
    test5,,bbb
    ,,
  • Read CSV as DataFrame

    Untitled

  • Create a DataFrame with None in Python

    Untitled

  • See what is different between these two DataFrame

    Untitled

  • How to create NaN

    Untitled

Calculate on NaN

Untitled

Why using NaN

Untitled

Untitled

Untitled

Untitled

Deal with NaN

  • Create sample DataFrame first

    Untitled

  • Check if values are NaN

    Untitled

  • Check if values are not NaN

    Untitled

  • Drop NaN

    Untitled

    Untitled

  • Fill NaN

    Untitled